#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    int singleNonDuplicate(vector<int>& nums) {
        for(int i=0;i<nums.size()-1;i+=2)
        {
            if(nums[i+1]!=nums[i])
                return nums[i];
        }
        return nums[nums.size()-1];//1 1 2
    }
};